Split

Basic and Crystal syntax.

Overloads
Arguments

Note:    Unlike in Visual Basic, in SCR if you omit an optional argument, you must omit all the following arguments. For example, if you do not specify a delimiter, you cannot specify count nor compare.

Returns

Array of String values.

Action

Split takes a String that contains a number of substrings, breaks it up into a specified number of substrings and returns an array containing the substrings.

Examples

The following examples are applicable to both Basic and Crystal syntax:

Split ("Chocolate Strawberry Pineapple")

Returns an array that contains 3 elements, "Chocolate", "Strawberry" and "Pineapple".

Split ("Chocolate//Strawberry//Pineapple", "//")

Returns an array that contains 3 elements, "Chocolate", "Strawberry" and "Pineapple".

Split ("Chocolate//Strawberry//Pineapple", "//", 2)

Returns an array that contains 2 elements, "Chocolate" and "Strawberry//Pineapple". The last element in the array is a concatenation of the 2nd substring and the remaining substring.

Split ("Chocolate and Strawberry and Pineapple", " And ", -1, 0)

Returns an array that contains 1 element, "Chocolate and Strawberry and Pineapple". The delimiter " And " cannot be matched.

Split ("Chocolate and Strawberry and Pineapple", " And ", -1, 1)

Returns an array that contains 3 elements, "Chocolate", "Strawberry" and "Pineapple". The delimiter " And " is matched with " and " regardless of the case.

Comments
Related topics

Join



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com